home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / REFERENC / TPR / TPR6.TXT < prev    next >
Text File  |  1992-10-19  |  59KB  |  1,595 lines

  1.                                    Chapter 6
  2.                                     of the
  3.                             Turbo Pascal Reference
  4.  
  5.                            The Turbo Vision Reference
  6.  
  7.  
  8. This chapter is part of the Turbo Pascal Reference electronic freeware book (C)
  9. Copyright 1992 by Ed Mitchell.  This freeware book contains supplementary
  10. material to Borland Pascal Developer's Guide, published by Que Corporation,
  11. 1992.  However, Que Corporation has no affiliation with nor responsibility for
  12. the content of this free book.  Please see Chapter 1 of the Turbo Pascal
  13. Reference for important information about your right to distribute and use this
  14. material freely.  If you find this material of use, I would appreciate your
  15. purchase of one my books, such as the Borland Pascal Developer's Guide or
  16. Secrets of the Borland C++ Masters, Sams Books, 1992.  Thank you.
  17.  
  18. For additional information on using Turbo Vision, including a detailed
  19. tutorial, please see Chapters 11 through 16 of the Borland Pascal Developer's
  20. Guide.
  21.  
  22.  
  23. About the Turbo Vision Reference
  24.  
  25.      The Turbo Vision Reference contains an alphabetized list of all Turbo
  26. Vision objects, global variables, procedures, functions, types and constant. 
  27. This reference is substantially different than Borland's reference because:
  28.  
  29.      1.  Where possible, example code that actually uses the object type is
  30.      shown.  Borland's documentation generally does not show sample code within
  31.      their Reference on Turbo Vision.
  32.  
  33.      2.  The reference includes all Turbo Vision features, including object
  34.      types, types, constants, variables, procedures and function.  All are
  35.      grouped together in one alphabetized section, unlike Borland's reference,
  36.      where you must look in several sections to find the desired item.
  37.  
  38.      3.  Most importantly, I have highlighted the methods that you are most
  39.      likely to use within each object type.  A problem with reading Borland's
  40.      documentation is that they present each object type followed by all twenty
  41.      to fifty possible methods within the object type.  In real applications,
  42.      though, you may only need to concern yourself with perhaps five to ten
  43.      methods.   Some of the variables and procedures are only useful to the
  44.      underlying implementation of Turbo Vision and may not be particularly
  45.      useful to your applications.  Nonetheless, these internal procedures,
  46.      where available, are included in the Reference and are designated as
  47.      "internal" procedures.
  48.  
  49.      When reading the Reference entires, keep in mind that since Turbo Vision
  50. objects are themselves usually derived from other Turbo Vision objects, it can
  51. be difficult to locate the definition of a particular method.  For example, you
  52. may see a procedure call such as,
  53.  
  54.      Shell.ReDraw;
  55.  
  56. where Shell is derived from TApplication.  You will need to look at the
  57. description of TProgram from which  TApplication  is derived, and then back to
  58. TView where you will finally locate the Redraw method. object which defines
  59. them.
  60.  
  61. Naming Conventions
  62.      Turbo Vision uses standardized naming conventions as an aid to making
  63. source code readable.  The most important conventions are:
  64. 1.   Type declarations begin with a capital letter T.
  65. 2.   Pointers to object types begin with a capital letter P.
  66. 3.   Registration records for stream I/O begin with a capital 
  67.      letter R.
  68. 4.   Except for color palette constants, identifiers beginning
  69.      with lower case letters are standard Turbo Vision constants.
  70.      The following table shows the standard constant prefix
  71.      characters:
  72.  
  73. Prefix  Definition               Example
  74.  
  75. ap      Application palette      apcolor
  76. bf      Button flag              bfdefault
  77. C       Color palettes           CListViewer
  78. cm      Command constant         cmok
  79. co      Collection codes         cooverflow
  80. dm      Drag mode                dmdraggrow
  81. ev      Event constant           evcommand
  82. gf      Grow mode flag           gfgrowall
  83. hc      Help context             hcnocontext
  84. kb      Keyboard code constant   kbalta
  85. mb      Mouse button constant    mbrightbutton
  86. of      Option flag              oftopselect
  87. P       Pointer equivalent       PCollection
  88. R       Registration record      RCollection
  89. sb      Scroll bar               sbrightarrow
  90. sf      State flag               sfactive
  91. sm      Screen mode constant     smfont8x8
  92. st      Stream code              stok
  93. T       Object type              TCollection
  94. wf      Window flags             wfmove
  95. wp      Window color palettes    wpbluewindow
  96.  
  97.  
  98.  
  99. The Turbo Vision Object Hierarchy
  100. --------------------------------
  101.      All Turbo Vision objects are descended from the TObject type.  All
  102. displayable objects are descendants of TView (which is itself descended from
  103. TObject).  Displayable objects include items such as dialogs, check boxes,
  104. buttons, windows and list boxes.  Non-displayable objects are the TCollection,
  105. TStream, TResourceFile, TStringList and TStrListMaker data structure objects.
  106.      The line of descent shown in the illustration, below, identifies how
  107. functionality is inherited between the objeccts.  For example, TDialog is
  108. descended from TWindow and inherits functionality from the TWindow object.   
  109.  
  110. Illustration showing inheritance relationships between the Turbo Vision object
  111. types.
  112.  
  113. TObject
  114.      TView
  115.           TBackground
  116.           TButton
  117.           TCluster
  118.               TCheckBoxes
  119.               TRadioButtons
  120.           TFrame
  121.           TGroup
  122.           TProgram
  123.               TApplication
  124.           TDeskTop
  125.           TWindow
  126.               TDialog
  127.               THistoryWindow
  128.           THistory
  129.           TInputLine
  130.           TListViewer
  131.               TListBox
  132.               THistoryViewer
  133.           TMenuView
  134.               TMenuBar
  135.               TMenuBox
  136.           TScroller
  137.               TTextDevice
  138.               TTerminal
  139.           TScrollBar
  140.           TStaticText
  141.               TLabel
  142.               TParamText
  143.           TStatusLine
  144.      TCollection
  145.           TSortedCollection
  146.           TStringCollection
  147.           TResourceCollection
  148.      TStream
  149.           TDosStream
  150.               TBufStream
  151.           TEmsStream
  152.      TResourceFile
  153.      TStringList
  154.      TStrListMaker
  155.  
  156.  
  157. Turbo Vision Object Descriptions
  158.  
  159.      The following reference section contains each procedure, function,
  160. variable, type and constant declaration defined in Turbo Vision, plus each of
  161. the primary Turbo Vision objects.  For the object descriptions, the information
  162. as organized into sections:
  163.  
  164. Turbo Vision Hierarchy
  165.      This section displays the derivation order of each object to help you
  166.      understand how functionally has been inherited from parent to descendant. 
  167.      For example, the TMenuBar object's derivation is indicated by this
  168.      drawing:
  169.  
  170.             TObject
  171.                TView
  172.                  TMenuView
  173.                                  TMenuBar
  174.  
  175.      This shows that TMenuBar is a descendant of TMenuView, which is a
  176.      descendant of TView, which is a descendant of TObject.
  177.  
  178. Discussion
  179.      A brief overview of the purpose of each object is given in this section.
  180.  
  181. Commonly Used Features
  182.      This section summarizes the primary methods that your applications will
  183.      likely use so that you will not need to spend much time attempting to
  184.      understand the other facilities of the object.  Many Turbo Vision objects
  185.      have a large variety of fields and methods available for use.  However,
  186.      many of these are needed only for the implementation of Turbo Vision
  187.      itself, and in most practical applications you will only need to reference
  188.      a small selection of the fields and methods.
  189.  
  190. Example
  191.      Where appropriate, a typical example usage of the object is given here.
  192.  
  193. Fields
  194.      Each field is described.  After the field's definition, a comment
  195.      indicating { Read only } or { Read/Write } indicates whether or not its
  196.      okay to directly access this field.
  197.  
  198. Methods
  199.      Every method defined for the object is presented in this section. 
  200.      Generally, more details are provided for those methods you are actually
  201.      likely to use, than for methods that are primarily of interest to
  202.      understanding the internal implementation of Turbo Vision.
  203.  
  204.  
  205.  
  206. Abstract procedure
  207. ------------------------------------------------------------
  208. Declaration:  
  209.      procedure Abstract;
  210.  
  211. Unit:
  212.       Objects
  213.  
  214. Purpose:
  215.      Calling this procedure terminates the program with run-time error 211. 
  216.      Theprocedure is normally placed in methods that must be overridden in
  217.      descendent object types.  By calling Abstract within such methods, this
  218.      insures that the program will stop execution if the programmer has failed
  219.      to override the method.
  220.  
  221.  
  222. Application variable
  223. ------------------------------------------------------------ 
  224. Declaration:  
  225.      Application : PApplication = nil;
  226.  
  227. Unit:  App
  228.  
  229. Purpose:
  230.      TApplication.Init, via TProgram.Init, sets Application to @Self, hence,
  231.      Application points to the application object.  TApplication.Done resets
  232.      Application to Nil.
  233.  
  234.  
  235. AppPalette variable
  236. ------------------------------------------------------------ 
  237. Declaration:
  238.      AppPalette : Integer = apColor;
  239.  
  240. Unit:  App
  241.  
  242. Purpose:
  243.      Holds the current application color palette selection (either apcolor,
  244.      apblackwhite or apmonochrome).
  245.      See:  TView.Setscreemode, apxxxx constants
  246.  
  247.  
  248.  
  249. apXXXX constants
  250. ------------------------------------------------------------
  251. Application Palette constants
  252.  
  253. Unit:                            App 
  254.  
  255. Purpose:
  256.      These values are kept in Apppalette, indicating which application color
  257.      palette is in use.
  258.  
  259. Constant             Value       Usage
  260. apcolor              0           Selects color screen palette
  261. apblackwhite         1           Selects black & white palette
  262. apmonochrome         2           Selects the monochrome screen
  263.                                  palette
  264.  
  265. See:  Apppalette 
  266.  
  267.  
  268.  
  269. AssignDevice procedure
  270. ------------------------------------------------------------ 
  271. Declaration:  
  272.      procedure AssignDevice (var T: Text; Screen: PTextDevice);
  273.  
  274. Unit:TexTView
  275.  
  276. Purpose:
  277.      This appears to be an internal Turbo Vision routine used in the TTerminal
  278.      object class for the purpose of implementing a scroll buffer that might be
  279.      used in computer terminal software program.
  280.  
  281.  
  282. bfXXXX constants
  283. ------------------------------------------------------------
  284. Button Flags constants
  285.  
  286. Unit:
  287.    Dialogs
  288.  
  289. Purpose:
  290. The bfxxxx values are passed as a bit mask to TButton.Init and specify button
  291. attributes, as shown in the table:
  292.  
  293. Constant             Value       Usage
  294. bfnormal             $00         non-default button
  295.  
  296. bfdefault            $01         This will be the default button
  297.  
  298. bfleftadjust         $02         If OR'd with either bfnormal or               
  299.                      bfdefault, the button label will
  300.                                  be left  justified instead of
  301.                                  centered.
  302.  
  303. bfbroadcast          $04         If this bit is set, when a
  304.                                  button is pressed, TButton sends
  305.                                  an evbroadcast  message.  If not 
  306.                                  set, TButton inserts a new event
  307.                                  with Putevent.
  308.  
  309. Caution:  Its up to the programmer to insure that each TGroup entity (TDialog
  310. is descended from TGroup) has only one default button.
  311.  
  312. See:  Example code in Chapter 11, "Turbo Vision Tutorial" in the Borland Pascal
  313. Developer's Guide, also see  TButton.Flags, TButton.Makedefault
  314.  
  315.  
  316.  
  317. ButtonCount variable
  318. ------------------------------------------------------------ 
  319. Declaration:  
  320.      ButtonCount : Byte = 0;
  321.  
  322. Unit:
  323.      Drivers
  324.  
  325. Purpose:
  326.      If a mouse is installed, Buttoncount holds the number of buttons on the
  327.      mouse.  If zero, then no mouse is installed.  Check the value of
  328.      Buttoncount when your program needs to know if a mouse is installed.
  329.  
  330.  
  331. CheckSnow variable
  332. ------------------------------------------------------------ 
  333. Declaration:  
  334.      CheckSnow : Boolean;
  335.  
  336. Unit:
  337.      Drivers
  338.  
  339. Purpose:
  340.      If a CGA adaptor is detected, Turbo Vision sets Checksnow to TRUE.  Older
  341.      CGA video adaptor cards require special programming to avoid "snow" or
  342.      static-like lines on the display.  If the CGA video adaptor does not
  343.      require snow checking, the program may set Checksnow to FALSE, resulting
  344.      in faster output to the screen.  Do not set or check Checksnow until after
  345.      calling TApplication.Init.
  346.  
  347.  
  348. Cxxxxxx Color Palette constants
  349. ------------------------------------------------------------
  350. See "Using Color Palettes" in chapter 13,  "More Turbo Vision Features" in the
  351. Borland Pascal Developer's Guide for complete details regarding use of the
  352. color palettes.  Except for CColor, CBlackWhite and CMonoChrome, all of the
  353. color palette constants contains indices into their owner's palette.  For
  354. CColor, CBlackWhite and CMonoChrome, each entry contains an actual BIOS video
  355. color attribute byte.
  356.  
  357. You can use these color palette maps to determine what color a particular
  358. object or component will have when it appears on the screen.  For example, if
  359. you place a TButton object into a TDialog object, you can trace through the
  360. color palettes to determine what color it will have.   A "normal" button will
  361. have the attribute "Text Normal" shown in the first byte of the CButton color
  362. palette.  This color entry is an index into its owner's palette, CDialog. 
  363. Looking at the 10th entry of CDialog, we see that this maps to entry 41 in the
  364. application-level palette.  In the case of CColor (color display in use), this
  365. corresponds to black lettering on a green background.
  366.  
  367. CBackground
  368. Byte Usage           Maps to     On this palette
  369. [ 1] Background      1           Application palettes
  370.  
  371.  
  372. CButton
  373. Byte Usage           Maps to     On this palette
  374. [ 1] Text Normal     10          CDialog palette
  375. [ 2] Text Default    11          
  376. [ 3] Text Selected   12
  377. [ 4] Text Disabled   13
  378. [ 5] Shortcut Normal 14
  379. [ 6] Shortcut Default            14
  380. [ 7] Shortcut Selected           14
  381. [ 8] Shadow          15
  382.  
  383. CCluster (used for TRadioButtons and TCheckBoxes)
  384. Byte Usage           Maps to     On this palette
  385. [ 1] Text Normal     16          CDialog
  386. [ 2] Text Selected   17
  387. [ 3] Shortcut Normal 18
  388. [ 4] Shortcut Selected           18
  389.  
  390.  
  391. CDialog
  392. Byte Usage           Maps to     On this palette
  393. [ 1] Frame Passive   32          Application palettes
  394. [ 2] Frame Active    33
  395. [ 3] Frame Icon      34
  396. [ 4] Scrollbar Page  35
  397. [ 5] Scrollbar controls          36
  398. [ 6] StaticText      37
  399. [ 7] Label Normal    38
  400. [ 8] Label Highlight 39
  401. [ 9] Label Shortcut  40
  402. [10] Button Normal   41
  403. [11] Button Default  42
  404. [12] Button Selected 43
  405. [13] Button Disabled 44
  406. [14] Button Shortcut 45
  407. [15] Button Shadow   46
  408. [16] Cluster Normal  47
  409. [17] Cluster Selected            48
  410. [18] Cluster Shortcut            49
  411. [19] Inputline Normal            50
  412. [20] Inputline Selected          51
  413. [21] Inputline Arrows            52
  414. [22] History Arrows  53
  415. [23] History sides   54
  416. [24] HistoryWindow
  417.      Scrollbar page  55
  418. [25] HistoryWindow
  419.      Scrollbar controls          56
  420. [26] ListViewer Normal           57
  421. [27] ListViewer Focused          58
  422. [28] ListViewer Selected         59
  423. [29] ListViewer Divided          60
  424. [30] InfoPane        61
  425. [31] Reserved        62
  426. [32] Reserved        63
  427.      
  428. CFrame
  429. Byte Usage           Maps to     On this palette
  430. [ 1] Passive frame   1           Standard window palettes
  431. [ 2] Passive Title   1
  432. [ 3] Active Frame    2
  433. [ 4] Active Title    2
  434. [ 5] Icons
  435.  
  436.  
  437. CHistory
  438. Byte Usage           Maps to     On this palette
  439. [ 1] Arrow           14          CDialog palette
  440. [ 2] Sides           20
  441.  
  442.  
  443. CHistoryViewer
  444. Byte Usage           Maps to     On this palette
  445. [ 1] Active          6           CDialog palette
  446. [ 2] Inactive        6
  447. [ 3] Focused         7
  448. [ 4] Selected        6
  449. [ 5] Divider         6
  450.  
  451.  
  452. CHistoryWindow
  453. Byte Usage           Maps to     On this palette
  454. [ 1] Frame passive   19          CDialog palette
  455. [ 2] Frame active    19
  456. [ 3] Frame icon      21
  457. [ 4] ScrollBar page area         24
  458. [ 5] Scrollbar controls          25
  459. [ 6] HistoryViewer
  460.      normal text     19
  461. [ 7] History Viewer
  462.      selected text   20
  463.  
  464.  
  465. CInputLine
  466. Byte Usage           Maps to     On this palette
  467. [ 1] Passive         19          CDialog palette
  468. [ 2] Active          19
  469. [ 3] Selected        20
  470. [ 4] Arrow           21
  471.  
  472.  
  473. CLabel
  474. Byte Usage           Maps to     On this palette
  475. [ 1] Text Normal     7           CDialog palette
  476. [ 2] Text Selected   8
  477. [ 3] Shortcut Normal 9
  478. [ 4] Shortcut Selected           9
  479.  
  480.  
  481. CListViewer (used for TListViewer and TLIistBox
  482. Byte Usage           Maps to     On this palette
  483. [ 1] Active          26          Application palette
  484. [ 2] Inactive        26
  485. [ 3] Focused         27
  486. [ 4] Selected        28
  487. [ 5] Divider         29
  488.  
  489.  
  490. CMenuView (used for TMenuBar and TMenuBox)
  491. Byte Usage           Maps to     On this palette
  492. [ 1] Text Normal     2           Application palette
  493. [ 2] Text Disabled   3
  494. [ 3] Text Shortcut   4
  495. [ 4] Selected Normal 5
  496. [ 5] Selected Disabled           6
  497. [ 6] Selected Shortcut           7
  498.  
  499.  
  500. CColor (for TProgram and TApplication)
  501. Byte Usage             Attribute Actual color displayed
  502.  Bytes 1 to 7 are used by menus and status lines
  503. [ 1] Background Text   $71       Blue on White
  504. [ 2] Normal Text       $70       Black on White
  505. [ 3] Disabled Text     $78       Blue on Gray
  506. [ 4] Shortcut text     $74       Blue on Red
  507. [ 5] Normal selection  $20       Green on Black
  508. [ 6] Disabled selection          $28         Green on Gray
  509. [ 7] Shortcut selection          $24         Green on Red
  510.  
  511.  Bytes 8 to 15 are used by blue windows
  512. [ 8] Frame Passive     $17       White on Blue
  513. [ 9] Frame Active      $1F       Bright White on Blue
  514. [10] Frame Icon        $1A       Light Green on Blue
  515. [11] Scrollbar page    $31       Blue on Cyan
  516. [12] Scrollbar reserved          $31         Blue on Cyan
  517. [13] Scroller Normal text        $1E         Yellow on Blue
  518. [14] Scroller Selected text      $71         Blue on White
  519. [15] Reserved          $00
  520.  
  521.  Bytes 16 to 23 are used by cyan windows
  522. [16] Frame Passive     $37       White on Cyan
  523. [17] Frame Active      $3F       Bright White on Cyan
  524. [18] Frame Icon        $3A       Light Green on Cyan
  525. [19] Scrollbar page    $13       Cyan on Blue
  526. [20] Scrollbar reserved          $13         Cyan on Blue
  527. [21] Scroller Normal text        $3E         Yellow on Cyan
  528. [22] Scroller Selected text      $21         Blue on Green
  529. [23] Reserved          $00
  530.  
  531.  Bytes 24 to 31 are used by gray windows
  532. [24] Frame Passive     $70       Black on White
  533. [25] Frame Active      $7F       Bright White on White
  534. [26] Frame Icon        $7A       Light Green on White
  535. [27] Scrollbar page    $13       Cyan on Blue
  536. [28] Scrollbar reserved          $13         Cyan on Blue
  537. [29] Scroller Normal text        $70         Black on White
  538. [30] Scroller Selected text      $7F         Bright White on White
  539. [31] Reserved          $00
  540.  
  541.  Bytes 32 to 63 are used by dialog box components.
  542. [32] Frame Passive     $70       Black on White
  543. [33] Frame Active      $7F       Bright White on White
  544. [34] Frame Icon        $7A       Light Green on White
  545. [35] Scrollbar Page    $13       Cyan on Blue
  546. [36] Scrollbar controls          $13         Cyan on Blue
  547. [37] Static text       $70       Black on White
  548. [38] Label Normal      $70       Black on White
  549. [39] Label Highlight   $7F       Bright White on White
  550. [40] Label Shortcut    $7E       Yellow on White
  551. [41] Button Normal     $20       Black on Green
  552. [42] Button Default    $2B       Light Cyan on Green
  553. [43] Button Selected   $2F       Bright White on Green
  554. [44] Button Disabled   $78       Gray on White
  555. [45] Button Shortcut   $2E       Yellow on Green
  556. [46] Button Shadow     $70       Black on White
  557. [47] Cluster Normal    $30       Black on Cyan
  558. [48] Cluster Selected  $3F       Bright White on Cyan
  559. [49] Cluster Shortcut  $3E       Yellow on Cyan
  560. [50] InputLine Normal  $1F       Bright White on Blue
  561. [51] InputLine Selected          $2F         Bright White on Green
  562. [52] InputLine Arrows  $1A       Light Green on Blue
  563. [53] History Arrow     $20       Black on Green
  564. [54] History Sides     $72       Green on White
  565. [55] Hist.Win. Scrollbar pg      $31         Blue on Cyan
  566. [56] H.W.Scrollbar     $31       Blue on Cyan
  567. [57] ListViewer Normal $30       Black on Cyan
  568. [58] ListViewer Focused          $2F         Bright White on Green
  569. [59] ListViewer Selected         $3E         Yellow on Cyan
  570. [60] ListViewer Divider          $31         Blue on Cyan
  571. [61] InfoPane          $13       Cyan on Blue
  572. [62] Reserved          $00
  573. [63] Reserved          $00
  574.  
  575.  
  576. CBlackWhite (for TProgram and TApplication)
  577. Byte Usage             Attribute Actual color displayed
  578.  
  579.  Bytes 1 to 7 are used by menus and status lines
  580. [ 1] Background Text   $70       Black on White
  581. [ 2] Normal Text       $70       Black on White
  582. [ 3] Disabled Text     $78       Gray on White
  583. [ 4] Shortcut text     $7F       Bright White on White
  584. [ 5] Normal selection  $07       White on Black
  585. [ 6] Disabled selection          $07         White on Black
  586. [ 7] Shortcut selection          $0F         Bright White on Black
  587.  
  588.  Bytes 8 to 15 are used by blue windows
  589. [ 8] Frame Passive     $07       White on Black
  590. [ 9] Frame Active      $0F       Bright White on Black
  591. [10] Frame Icon        $07       White on Black
  592. [11] Scrollbar page    $70       Black on White
  593. [12] Scrollbar reserved          $70         Black on White
  594. [13] Scroller Normal text        $07         White on Black
  595. [14] Scroller Selected text      $70         White on Black
  596. [15] Reserved          $00
  597.  
  598.  Bytes 16 to 23 are used by cyan windows
  599. [16] Frame Passive     $07       White on Black
  600. [17] Frame Active      $0F       Bright White on Black
  601. [18] Frame Icon        $07       White on Black
  602. [19] Scrollbar page    $70       Black on White
  603. [20] Scrollbar reserved          $70         Black on White
  604. [21] Scroller Normal text        $07         White on Black
  605. [22] Scroller Selected text      $70         Black on White
  606. [23] Reserved          $00
  607.  
  608.  Bytes 24 to 31 are used by gray windows
  609. [24] Frame Passive     $70       Black on White
  610. [25] Frame Active      $7F       Bright White on White
  611. [26] Frame Icon        $7F       Bright White on White
  612. [27] Scrollbar page    $70       Black on White
  613. [28] Scrollbar reserved          $07         White on Black
  614. [29] Scroller Normal text        $70         Black on White
  615. [30] Scroller Selected text      $07         White on Black
  616. [31] Reserved                    $00
  617.  
  618.  Bytes 32 to 63 are used by dialog box components.
  619. [32] Frame Passive     $70       Black on White
  620. [33] Frame Active      $7F       Bright White on White
  621. [34] Frame Icon        $7F       Bright White on White
  622. [35] Scrollbar Page    $70       Black on White
  623. [36] Scrollbar controls          $07         White on Black
  624. [37] Static text       $70       Black on White
  625. [38] Label Normal      $70       Black on White
  626. [39] Label Highlight   $7F       Bright White on White
  627. [40] Label Shortcut    $7F       Bright White on White
  628. [41] Button Normal     $07       White on Black
  629. [42] Button Default    $0F       Bright White on Black
  630. [43] Button Selected   $0F       Bright White on Black
  631. [44] Button Disabled   $78       Gray on White
  632. [45] Button Shortcut   $0F       Bright White on Black
  633. [46] Button Shadow     $78       Gray on White
  634. [47] Cluster Normal    $07       White on Black
  635. [48] Cluster Selected  $0F       Bright White on Black
  636. [49] Cluster Shortcut  $0F       Bright White on Black
  637. [50] InputLine Normal  $0F       Bright White on Black
  638. [51] InputLine Selected          $70         Black on White
  639. [52] InputLine Arrows  $0F       Bright White on Black
  640. [53] History Arrow     $07       White on Black
  641. [54] History Sides     $70       Black on White
  642. [55] Hist.Win. Scrollbar pg      $70         Black on White
  643. [56] H.W.ScrollBar     $70       Black on White
  644. [57] ListViewer Normal $07       White on Black
  645. [58] ListViewer Focused          $70         Black on White
  646. [59] ListViewer Selected         $0F         Bright White on Black
  647. [60] ListViewer Divider          $07         White on Black
  648. [61] InfoPane          $07       White on Black
  649. [62] Reserved          $00
  650. [63] Reserved          $00
  651.  
  652.  
  653. CMonoChrome (for TProgram and TApplication)
  654. Byte Usage             Attribute   Actual color displayed
  655.  Bytes 1 to 7 are used by menus and status lines
  656. [ 1] Background Text   $70       Black on White
  657. [ 2] Normal Text       $07       White on Black
  658. [ 3] Disabled Text     $07       White on Black
  659. [ 4] Shortcut text     $0F       Bright White on Black
  660. [ 5] Normal selection  $70       Black on White
  661. [ 6] Disabled selection          $70         Black on White
  662. [ 7] Shortcut selection          $70         Black on White
  663.  
  664.  Bytes 8 to 15 are used by blue windows
  665. [ 8] Frame Passive     $07       White on Black
  666. [ 9] Frame Active      $0F       Bright White on Black
  667. [10] Frame Icon        $07       White on Black
  668. [11] Scrollbar page    $70       Black on White
  669. [12] Scrollbar reserved          $70         Black on White
  670. [13] Scroller Normal text        $07         White on Black
  671. [14] Scroller Selected text      $70         Black on White
  672. [15]                   Reserved  $00
  673.  
  674.  Bytes 16 to 23 are used by cyan windows
  675. [16] Frame Passive     $07       White on Black
  676. [17] Frame Active      $0F       Bright White on Black
  677. [18] Frame Icon        $07       White on Black
  678. [19] Scrollbar page    $70       Black on White
  679. [20] Scrollbar reserved          $70         Black on White
  680. [21] Scroller Normal text        $07         White on Black
  681. [22] Scroller Selected text      $70         Black on White
  682. [23] Reserved          $00
  683.  
  684.  Bytes 24 to 31 are used by gray windows
  685. [24] Frame Passive     $70       Black on White
  686. [25] Frame Active      $70       Black on White
  687. [26] Frame Icon        $70       Black on White
  688. [27] Scrollbar page    $07       White on Black
  689. [28] Scrollbar reserved          $07         White on Black
  690. [29] Scroller Normal text        $70         Black on White
  691. [30] Scroller Selected text      $07         White on Black
  692. [31]                   Reserved  $00
  693.  
  694.  Bytes 32 to 63 are used by dialog box components.
  695. [32] Frame Passive     $70       Black on White
  696. [33] Frame Active      $70       Black on White
  697. [34] Frame Icon        $70       Black on White
  698. [35] Scrollbar Page    $07       White on Black
  699. [36] Scrollbar controls          $07         White on Black
  700. [37] Static text       $70       Black on White
  701. [38] Label Normal      $70       Black on White
  702. [39] Label Highlight   $70       Black on White
  703. [40] Label Shortcut    $7F       Bright White on White
  704. [41] Button Normal     $07       White on Black
  705. [42] Button Default    $07       White on Black
  706. [43] Button Selected   $0F       Bright White on Black
  707. [44] Button Disabled   $70       Black on White
  708. [45] Button Shortcut   $0F       Bright White on Black
  709. [46] Button Shadow     $70       Black on White
  710. [47] Cluster Normal    $07       White on Black
  711. [48] Cluster Selected  $0F       Bright White on Black
  712. [49] Cluster Shortcut  $0F       Bright White on Black
  713. [50] InputLine Normal  $07       White on Black
  714. [51] InputLine Selected          $70         Black on White
  715. [52] InputLine Arrows  $07       White on Black
  716. [53] History Arrow     $07       White on Black
  717. [54] History Sides     $70       Black on White
  718. [55] Hist.Win. Scrollbar pg      $07         White on Black
  719. [56] H.W.ScrollBar     $07       White on Black
  720. [57] ListViewer Normal $07       White on Black
  721. [58] ListViewer Focused          $70         Black on White
  722. [59] ListViewer Selected         $0F         Bright White on Black
  723. [60] ListViewer Divider          $07         White on Black
  724. [61]                   InfoPane  $07         White on Black
  725. [62]                   Reserved  $00
  726. [63]                   Reserved  $00
  727.  
  728.  
  729. CScrollBar
  730. Byte Usage             Maps to   On this palette
  731. [ 1] Page              4         Application palette
  732. [ 2] Arrows            5
  733. [ 3] Indicator         5
  734.  
  735.  
  736. CScroller
  737. Byte Usage             Maps to   On this palette
  738. [ 1] Normal            6         Application palette
  739. [ 2] Highlight         7
  740.  
  741.  
  742.  
  743. CStaticText
  744. Byte Usage             Maps to   On this palette
  745. [ 1] Text color        6         CDialog
  746.  
  747.  
  748. CStatusLine
  749. Byte Usage             Maps to   On this palette
  750. [ 1] Text Normal       2         Application palette
  751. [ 2] Text Disabled     3
  752. [ 3] Text Shortcut     4
  753. [ 4] Selected Normal   5
  754. [ 5] Selected Disabled 6
  755. [ 6] Selected Shortcut 7
  756.  
  757.  
  758. CGrayWindow
  759. Byte Usage             Maps to   On this palette
  760. [ 1] Frame Passive     24        Application palette
  761. [ 2] Frame Active      25
  762. [ 3] Frame Icon        26
  763. [ 4] ScrollBar page    27
  764. [ 5] ScrollBar reserved          28
  765. [ 6] Scroller Normal Text        29
  766. [ 7] Scroller Selected Text      30
  767. [ 8] Reserved          31
  768.  
  769.  
  770.  
  771. CBlueWindow
  772. Byte Usage             Maps to   On this palette
  773. [ 1] Frame Passive     8         Application palette
  774. [ 2] Frame Active      9
  775. [ 3] Frame Icon        10
  776. [ 4] ScrollBar page    11
  777. [ 5] ScrollBar reserved          12
  778. [ 6] Scroller Normal Text        13
  779. [ 7] Scroller Selected Text      14
  780. [ 8] Reserved          15
  781.  
  782.  
  783.  
  784. CCyanWindow
  785. Byte Usage             Maps to   On this palette
  786. [ 1] Frame Passive     16        Application palette
  787. [ 2] Frame Active      17
  788. [ 3] Frame Icon        18
  789. [ 4] ScrollBar page    19
  790. [ 5] ScrollBar reserved          20
  791. [ 6] Scroller Normal Text        21
  792. [ 7] Scroller Selected Text      22
  793. [ 8] Reserved          23
  794.  
  795.  
  796. ClearHistory procedure
  797. ------------------------------------------------------------
  798. Declaration:  
  799.      procedure ClearHistory;
  800.  
  801. Unit: HistList
  802.  
  803. Purpose: 
  804.      Removes all strings from all history lists.
  805.  
  806.  
  807. ClearScreen procedure
  808. ------------------------------------------------------------
  809. Declaration: 
  810.      procedure ClearScreen;
  811.  
  812. Unit: Drivers
  813.  
  814. Purpose:
  815.      After Initvideo has been called by TApplication.Init, this procedure will
  816.      clear the screen. However, most Turbo Vision applications will have no
  817.      need to use this procedure.
  818.  
  819.  
  820. cmxxxx constants
  821. ------------------------------------------------------------
  822. Command constants
  823.  
  824. Unit: Views
  825.  
  826. Purpose:
  827.      The cmxxxx constants are the predefined commands within Turbo Vision and
  828.      are passed to Handleevent methods in the Event.Command field.  Constant
  829.      values of 0 to 99, and 256 to 999 are reserved for use by Turbo Vision. 
  830.      Your applications can define command constants in the range 100 to 255,
  831.      and 1000 to 65535.
  832.  
  833. Constant         Value   Usage
  834.  
  835. cmvalid             0    Message passed to TView.Valid
  836.  
  837. cmquit              1    Upon receipt of cmquit,       
  838.                          TProgram.Handleevent terminates the application.  The
  839.                          Alt-X keystroke is normally mapped to the cmquit 
  840.                          command.
  841.  
  842. cmerror             2    No object should handle this command.
  843.                          Instead, use cmerror as away of trapping any
  844.                          unimplemented  commands (i.e. while the program is
  845.                          still in development).
  846.  
  847. cmmenu              3    This internal command is used to
  848.                          initiate menu selection.  The status line, as shown in
  849.                          Chapter 14, typically maps the F10 key to cmmenu.  See
  850.                          TSTATUSLINE.
  851.  
  852. cmclose             4    For modeless window's, clicking in a
  853.                          window'sclose box causes the  cmclose command to be
  854.                          sent to the  window and the window's Close method  is
  855.                          called.  To prevent closing a  window, you can
  856.                          intercept the cmclose command in your derived window's
  857.                          Handleevent method (also  see the wfclose constants). 
  858.                          Typically a status line item such as  Alt-F3 is mapped
  859.                          to the cmclose  command.  The TVSHELL1 program in 
  860.                          Chapter 14 uses the F3 key to generate cmclose for
  861.                          opening and  closing subdirectories. 
  862.  
  863. cmzoom              5    The cmzoom flag is generated when the
  864.                          window is zoomed.  You can  prevent zooming by
  865.                          intercepting the cmzoom command (also see the wfzoom
  866.                          constant).  By convention, Turbo  Vision applications
  867.                          often use the F5  key to denote a zoom.  
  868.  
  869. cmresize            6    cmresize is sent when a window is  
  870.                          resized.  Also see wfmove and wfgrow.  By convention,
  871.                          Ctrl-F5 is often used to zoom a window.
  872.  
  873. cmnext              7    Causes the last window on the desktop to
  874.                          be moved to in front of  all the others.  F6 is often
  875.                          used as a short cut key for this command.
  876.  
  877. cmprev              8    Moves the first window on the desktop to
  878.                          behind all the other  windows.  Shift-F6 is often used
  879.                          as a short cut key for this command.
  880.  
  881. cmok                9    In a dialog, this value is returned if
  882.                          the Okay button was pressed.
  883.  
  884. cmcancel            10   In a dialog, this value is returned if
  885.                          the Cancel button was pressed, or  if the keyboard
  886.                          Escape key was  pressed, or a dialog's close icon  was
  887.                          clicked.
  888.  
  889. cmyes               11   In a dialog, this is a standard value to
  890.                          be returned by a Yes  button.
  891.  
  892. cmno                12   In a dialog, this is the standard value
  893.                          to be returned by a No button.
  894.  
  895. cmdefault           13   Is used to indicate a "default" button
  896.                          selection.
  897.  
  898. cmreceivedfocus     50   Together with cmreleasedfocus, this
  899.                          command is sent by TView.Setstate to  inform peer
  900.                          views of a change in focus.  Views may use these
  901.                          messages to change their  appearance (for example, a
  902.                          when a button loses focus, it is no longer
  903.                          highlighted).
  904.  
  905. cmreleasedfocus     51   See above.
  906.  
  907. cmcommandsetchanged 52   Whenever Enablecommands,  
  908.                          Disablecommands or Setcommands  changes the command
  909.                          set, this message is broadcast to every view's
  910.                          Handleevent method, giving them a  chance to redraw
  911.                          themselves if the command set change affects how they
  912.                          should appear.
  913.  
  914. cmscrollbarchanged  53   When a scroll bar's position indicator
  915.                          moves, the scrollbar sends  this broadcast message to
  916.                          its owner.
  917.  
  918. cmscrollbarclicked  54   When the mouse is clicked on a Scroll
  919.                          bar, the scroll bar  broadcasts this message to its 
  920.                          owner.
  921.  
  922. cmselectwindownum   55   This broadcast message is sent when the
  923.                          keyboard keys Alt-1 through Alt-9 are pressed to
  924.                          select a specific  window. The window who's 
  925.                          TWindow.Number field matches the  selection number
  926.                          (passed in Event.Infoint), responds by selecting
  927.                          itself with TView.Select.
  928.  
  929. cmlistitemselected  56   Whenever an item in a list viewer is
  930.                          selected, the TListViewer sends this as an evbroadcast
  931.                          message.
  932.  
  933. cmrecordhistory     60   When received by a THISTORY object, this
  934.                          message causes it to record the contents of the
  935.                          TINPUTLINE object  that it owns.
  936.  
  937.  
  938. coxxxx constants
  939. ------------------------------------------------------------
  940. Collection Error contants
  941.  
  942.  
  943. Unit:  Objects
  944.  
  945. Purpose:
  946.      When a TCollection error occurs, the method TCollection.Error is called,
  947.      with the Code parameter having one of the values shown in the table.
  948.  
  949. Constant    Value        Usage
  950. coindexerror             -1   Means that the index is out of range.
  951.                          In this case, the Info parameter of Error contains the
  952.                           invalid index.
  953.  
  954. cooverflow  -2           The collection could not be expanded
  955.                          any further.
  956.  
  957.  
  958. cStrLen Function
  959. --------------------------------------------------------------
  960.  
  961. Declaration:
  962.     function CStrLen( S : String ) : Integer;
  963.  
  964. Unit: Drivers
  965.  
  966. Purpose:
  967.      Returns the length of control strings, which are any strings containing
  968.      short-cut characters surrounded by tilde '~' characters, minus the number
  969.      of tilde characters. For example,
  970.             CStrLen( '~F~ile' )
  971.      has a length of 4.
  972.  
  973.  
  974. CtrlBreakHit variable
  975. ------------------------------------------------------------ 
  976. Declaration:  
  977.     CtrlBreakHit : Boolean = False;
  978.  
  979. Unit: Drivers
  980.  
  981. Purpose:
  982.      Whenever the user presses Ctrl-Break at the keyboard, this flag is set to
  983.      TRUE.  You can clear it any time by resetting to FALSE.
  984.  
  985.  
  986.  
  987. CtrlToArrow function
  988. ------------------------------------------------------------ 
  989. Declaration:
  990.     function CtrlToArrow( KeyCode : Word): Word;
  991.  
  992. Unit: Drivers
  993.  
  994. Purpose:
  995.      This esoteric function converts certain control-key combinations to
  996.      standard kbxxxx constant values.  The original Wordstar word processor
  997.      used a standard set of Ctrl-letter combinations as equivalents to IBM
  998.      cursor movement keys and set a standard interpretation of these keys when
  999.      used in word processing.  To assist in providing Wordstar compatibility,
  1000.      Ctrltoarrow can be used to convert Event.Keycode values to their
  1001.      corresponding kbxxxx values.  The following chart shows the mapping from
  1002.      control keys to kbxxxx values.
  1003.  
  1004. Control key     Lo(Keycode)  Maps to
  1005. Ctrl-A          $01          kbhome
  1006. Ctrl-D          $04          kbright
  1007. Ctrl-E          $05          kbup
  1008. Ctrl-F          $06          kbend
  1009. Ctrl-G          $07          kbdel
  1010. Ctrl-S          $13          kbleft
  1011. Ctrl-V          $16          kbins
  1012. Ctrl-X          $18          kbdown
  1013.  
  1014.  
  1015. CursorLines variable
  1016. ------------------------------------------------------------ 
  1017. Declaration:    
  1018.      CursorLines : Word;
  1019. Unit:
  1020.      Drivers
  1021.  
  1022. Purpose:
  1023.      Contains the height of the video cursor encoded such that the high 4 bits
  1024.      contains the top scan line and the low 4 bits contain the bottom scan
  1025.      line.  For example, on a CGA screen a character is made up of 8 scan
  1026.      lines, with the topmost scan line being 0 and the bottommost scan line
  1027.      being 7 (the number of scan lines varies according to the type of the
  1028.      video adaptor card in use).  The shape of the character cursor is
  1029.      determined with BIOS interrupt 10H, function 01H. For more information,
  1030.      consult the DOS Programmer's Reference, 2nd Edition, Que Books, page 424
  1031.      "BIOS INT 10H Function 01h Set Cursor Type".
  1032.      See:  TView.Showcursor, TView.Hidecursor, TView.Normalcursor (to set
  1033.      cursor shape to an underline), TView.BlockCursor (to set cursor to a solid
  1034.      block).
  1035.  
  1036.  
  1037. DeskTop variable
  1038. ------------------------------------------------------------ 
  1039. Declaration:  
  1040.      DeskTop: PDeskTop = nil;
  1041.  
  1042. Unit:  App
  1043.  
  1044. Purpose:
  1045.      Contains a pointer to the application's TDESKTOP object, and can be used
  1046.      to insert a window or dialog on to the desktop.  For example,
  1047.         DeskTop^.Insert( New( PDirectoryWindow,
  1048.            Init(Bounds, 'Directory Listing', 0 )));
  1049.  
  1050.  
  1051. DisposeMenu procedure
  1052. ------------------------------------------------------------ 
  1053. Declaration:
  1054.      procedure DisposeMenu( Menu: PMenu );
  1055.  
  1056. Unit:  Menus
  1057.  
  1058. Purpose:  
  1059.      Disposes of a menu and all of its submenus.
  1060.  
  1061.  
  1062. DisposeStr procedure
  1063. ------------------------------------------------------------ 
  1064. Declaration: 
  1065.      procedure DisposeStr(P : PString);
  1066.  
  1067. Unit: Objects
  1068.  
  1069. Purpose:
  1070.      Disposes of PSTRINGS allocated by Newstr.  See Chapter 20, "Collections"
  1071.      for an example of using the PSTRING type, and the Newstr and Disposestr
  1072.      routines. 
  1073.  
  1074.  
  1075. dmXXXX constants
  1076. ------------------------------------------------------------
  1077. Drag Mode constants
  1078.  
  1079. Unit:  Views
  1080.  
  1081. Purpose:
  1082. The TView.Dragmode field controls whether or not a view can be dragged or have
  1083. it size changed.  The Dragmode field is stored in a byte, with the bits set by
  1084. the constants shown in the following table, and Limits is a TRECT parameter to
  1085. TView.Dragview.
  1086.  
  1087. Constant        Value   Usage
  1088. dmdragmove      $01     Allow the view to move.
  1089. dmdraggrow      $02     Allow the view to change size.
  1090. dmlimitlox      $10     The left hand side cannot move outside
  1091.                          Limits.
  1092. dmlimitloy      $20     The top side cannot move outside  
  1093.                          Limits.
  1094. dmlimithix      $40     The right hand side cannot move outside
  1095.                          Limits.
  1096. dmlimithiy      $80     The bottom side cannot move outside
  1097.                          Limits.
  1098. dmlimitall      $F0     None of the view can move outside
  1099.                          Limits.
  1100.  
  1101.  
  1102. DoneEvents procedure
  1103. ------------------------------------------------------------
  1104. Declaration:  
  1105.      procedure DoneEvents;
  1106.  
  1107. Unit: Drivers
  1108.  
  1109. Purpose:
  1110.      This is a Turbo Vision internal routine that will not normally be used by
  1111.      your applications.  Doneevents disables the mouse interrupt handler and
  1112.      hides the mouse.
  1113.  
  1114.  
  1115. DoneHistory procedure
  1116. ------------------------------------------------------------
  1117. Declaration:  
  1118.      procedure DoneHistory;
  1119.  
  1120. Unit: HistList
  1121.  
  1122. Purpose:
  1123.      This internal Turbo Vision routine is called automatically by
  1124.      TApplication.Done to free up the history block allocated by Inithistory.
  1125.  
  1126.  
  1127. DoneMemory procedure
  1128. ------------------------------------------------------------
  1129. Declaration: 
  1130.      procedure DoneMemory;
  1131.  
  1132. Unit: Memory
  1133.  
  1134. Purpose:
  1135.      This internal Turbo Vision routine is called automatically by
  1136.      TApplication.Done to free up all memory buffers that were allocated by
  1137.      Getbufmem.
  1138.  
  1139.  
  1140. DoneSysError procedure
  1141. ------------------------------------------------------------
  1142. Declaration:
  1143.      procedure DoneSysError;
  1144.  
  1145. Unit:  Drivers
  1146.  
  1147. Purpose:
  1148.      This internal routine is called automatically by TApplication.Done,
  1149.      terminating Turbo Vision's system error trapping and restoring the
  1150.      interrupt vectors 09h, 1bh, 21h, 23h and 24h and the Ctrl-Break checking
  1151.      of DOS, to their original settings.
  1152.  
  1153.  
  1154. DoneVideo procedure
  1155. ------------------------------------------------------------
  1156. Declaration:  
  1157.      procedure DoneVideo;
  1158.  
  1159. Unit:  Drivers
  1160.  
  1161. Purpose:
  1162.      This internal routine is called automatically by TApplication.Done and
  1163.      terminates Turbo Vision's video support.
  1164.  
  1165.  
  1166. DoubleDay variable
  1167. ------------------------------------------------------------
  1168. Declaration:  
  1169.      DoubleDelay : Word = 8;
  1170.  
  1171. Unit:  Drivers
  1172.  
  1173. Purpose:
  1174.      Doubledelay holds the time interval (in 1/18.2 of a second intervals)
  1175.      defining how quickly two mouse clicks must occur in order to be treated as
  1176.      a double click (rather than two separate single clicks).  By default, the
  1177.      two mouse clicks must occur with 8/18'ths of a second to be considered a
  1178.      double click event (with TEVENT.Double set to TRUE).
  1179.  
  1180.  
  1181. EmsCurHandle variable
  1182. ------------------------------------------------------------
  1183. Declaration:  EmsCurHandle: Word = $FFFF;
  1184.  
  1185. Unit: Objects
  1186.  
  1187.  
  1188. ErrorAttr variable
  1189. ------------------------------------------------------------
  1190. Declaration:  
  1191.      const ErrorAttr: Byte = $CF;
  1192.  
  1193. Unit: Views
  1194.  
  1195. Purpose:
  1196.      If the TView.Getcolor method is unable to map a color palette index into a
  1197.      video attribute byte because the index is out of range, TView.Getcolor
  1198.      returns this value. $CF is the video attribute for flashing white
  1199.      characters on a red background - if you see flashing white on red, you
  1200.      need to check or override the Getpalette method.  An example of how this
  1201.      works can be seen in the TVSHELL program.  If the TDIRLIST.Getpalette
  1202.      method is removed from TDIRLIST, the listbox text will appear as flashing
  1203.      white on red.  This occurs because the palette indices for a TListViewer,
  1204.      26, 27, 28 and 29 are out of range for the window palette into which the
  1205.      list viewer is inserted.  The solution is to override Getpalette to return
  1206.      values within an acceptable range.
  1207.      See:  Chapter 13, "More Turbo Vision Features" in Borland Pascal
  1208.      Developer's Guide, Que Books, 1992.
  1209.  
  1210.  
  1211. evXXXX constants
  1212. ------------------------------------------------------------
  1213. Event constants
  1214.  
  1215. Unit:  Drivers
  1216.  
  1217. Purpose:
  1218.      The evxxxx constants are used to designate event types and event masks,
  1219. particularly as used in the What field of an event record but also in other
  1220. places within Turbo Vision.
  1221.  
  1222. Constant       Value   Usage
  1223. ----------------------------------------
  1224. evmousedown    $0001   Mouse button pressed
  1225. evmouseup      $0002   Mouse button released
  1226. evmousemove    $0004   Mouse has changed location
  1227. evmouseauto    $0008   This event occurs periodically while
  1228.                        the mouse button is held down
  1229. evkeydown      $0010   A key has been pressed.
  1230. evcommand      $0100   The event type is a command event.
  1231. evbroadcast    $0200   The event type is a broadcast event.
  1232. evnothing      $0000   This event was already handled.
  1233. evmouse        $000F   The event type is a mouse event.
  1234. evkeyboard     $0010   The event type is a keyboard event.
  1235. evmessage      $FF00   The event is a message event, which
  1236.                          can be either user defined, an  evCommand or
  1237.                          evBroadcast event.
  1238.  
  1239. See:  See "Introduction to Events and the HandleEvent Method", in Chapter 11,
  1240. "Turbo Vision Tutorial" in the Borland Pascal Developer's Guide.  Also see
  1241. Positionalevents and Focusedevents.
  1242.  
  1243.  
  1244. FNameStr type
  1245. ------------------------------------------------------------
  1246. Declaration:  
  1247.      type FNameStr = string[79];
  1248.  
  1249. Unit:  Objects
  1250.  
  1251. Purpose:
  1252.      This type is used to declare strings containing DOS file names.
  1253.  
  1254.  
  1255. FocusedEvents variable
  1256. ------------------------------------------------------------
  1257. Declaration:  
  1258.      FocusedEvents: Word = evKeyboard + evCommand;
  1259.  
  1260. Unit: Views
  1261.  
  1262. Purpose:
  1263.      Focusedevents contains a bit mask for identifying events that are focused.
  1264.      Any event that is neither a focused event nor a positional event, is
  1265.      classed as a broadcast event.
  1266.      See:  Positionalevents variable, and "Positional Events" in Chapter 13,
  1267.      "More Turbo Vision Features" in the Borland Pascal Developer's Guide.
  1268.  
  1269.  
  1270. FormatStr procedure
  1271. ------------------------------------------------------------
  1272. Declaration:  
  1273.      FormatStr( var Result: String; Format: String; var Params);
  1274.  
  1275. Unit: Drivers
  1276.  
  1277. Purpose:
  1278.      Formatstr takes a string Format and a list of parameters in Params and
  1279.      produces a formatted string that is returned in Result.  Formatstr is
  1280.      typically used to insert parameter values into predefined strings, such as
  1281.      those used for error messages, or general program strings stored in a
  1282.      resource file.  The Format string contains both text and imbedded
  1283.      formatting information, as in this example:
  1284.                'File %s is %d bytes in size.'
  1285.      The formatting characters %s and %d indicate that a string and a decimal
  1286.      value, respectively, should be substituted in these locations.  The values
  1287.      for the substitutions are specified in the Params parameter as shown in
  1288.      the example code, below.
  1289.  
  1290.  
  1291.      Format specifiers have the form % [-] [nnn] X, where the brackets indicate
  1292.      optional items and X is a format character.
  1293.  
  1294. Table of Format Specifiers
  1295. %    Marks the beginning of a format specifier
  1296.  
  1297. -    Indicates the items should be left justified (default
  1298.      is right justified)
  1299.  
  1300. nnn  
  1301.      Specifies the width of the result, where nnn is in the range from 0 to
  1302.      255.
  1303.      0 is equivalent to not specifying a  width.  If nnn is less than the width
  1304.      needed to display a particular item, the the item is truncated to fit
  1305.      within the width value.  For example, %3s allocates 3 character spaces. 
  1306.      Ifthe string parameter contains 'Turbo', then only the last 3 characters
  1307.      'rbo' will be inserted into the result.  If you use %-3s, then only the
  1308.      first 3  characters will be inserted, giving 'Tur'.
  1309.  
  1310. s    Format character indicating the parameter is a string
  1311.      pointer.
  1312.  
  1313. d    Format character indicating the parameter is a Longint and
  1314.      is to be displayed in decimal.
  1315.  
  1316. c    Format character specifying the low byte of the parameter
  1317.      is a character value.
  1318.  
  1319. x    Format character specifying the parameter is a Longint to
  1320.      be displayed in hexadecimal.
  1321.  
  1322. #    Resets the parameter index to the optional nnn value.
  1323.  
  1324. Params Parameter
  1325.      The Params parameter variable contains the data corresponding to each item
  1326. specified in the format string. There are two ways that the Params variable can
  1327. be initialized:  
  1328.      1) Use a record structure, 
  1329.      2) Or, use an array of Longint.
  1330. Listing FORMAT1.PAS shows the record structure method, and Listing FORMAT2.PAS
  1331. shows the array method.  The record structure has the advantage of being easier
  1332. to read, since each parameter is named in the record, while the array structure
  1333. is more flexible, in that it can be dynamically set up to accomodate many
  1334. different types of parameters.
  1335.  
  1336. Listing FORMAT1.PAS:
  1337. -------------------
  1338. program DemoFormat;
  1339. { FORMAT1.PAS
  1340.   Demonstrates use of the Turbo Vision FormatStr procedure  using
  1341.   a parameter record.
  1342. }
  1343.  
  1344. uses
  1345.   Drivers, Objects;
  1346.  
  1347. type
  1348.   TParamRec = record
  1349.     FName : PString;
  1350.     FBytes: LongInt;
  1351.   end;
  1352.  
  1353. var
  1354.   ParamRec : TParamRec;
  1355.   ResultStr: String;
  1356.  
  1357. begin
  1358.  
  1359.   ParamRec.FName := NewStr('SAMPLE.TXT');
  1360.   ParamRec.FBytes := 654321;
  1361.      FormatStr( ResultStr, 'File %s is %d bytes in size.',                     
  1362.      ParamRec );
  1363.  
  1364.   Writeln( ResultStr );
  1365.   Write('Press Enter to Continue.');
  1366.   Readln;
  1367. end.
  1368.  
  1369.  
  1370. Listing FORMAT2.PAS:
  1371. -------------------
  1372. program DemoFormat;
  1373. { FORMAT2.PAS
  1374.   Demonstrates use of the Turbo Vision FormatStr procedure  using a parameter
  1375. array.
  1376. }
  1377.  
  1378. uses
  1379.   Drivers, Objects;
  1380.  
  1381. type
  1382.   TParamArray = array[0..1] of LongInt;
  1383.  
  1384. var
  1385.   ParamArray : TParamArray;
  1386.   ResultStr: String;
  1387.  
  1388. begin
  1389.  
  1390.   ParamArray[0] := LongInt(NewStr('SAMPLE.TXT'));
  1391.   ParamArray[1] := 654321;
  1392.  
  1393.   FormatStr( ResultStr, 'File %s is %d bytes in size.',                        
  1394.      ParamArray );
  1395.  
  1396.   Writeln( ResultStr );
  1397.   Write('Press Enter to Continue.');
  1398.   Readln;
  1399. end.
  1400.  
  1401.  
  1402. FreeBufMem procedure
  1403. ------------------------------------------------------------
  1404. Declaration:  
  1405.      procedure FreeBufMem(P : Pointer);
  1406.  
  1407. Unit:  Memory
  1408.  
  1409. Purpose:
  1410.      Frees up the cache buffer pointed to by P.  See Getbufmem for details.
  1411.  
  1412.  
  1413. GetAltChar function
  1414. ------------------------------------------------------------
  1415. Declaration:  
  1416.      function GetAltChar(KeyCode: Word): Char;
  1417.  
  1418. Unit:  Drivers
  1419.  
  1420. Purpose:
  1421.      When Keycode specifies an Alt-Ch character combination, where Ch is a
  1422.      letter from A to Z, Getaltchar extracts and returns the Ch character
  1423.      value.  For example,
  1424.              writeln( GetAltChar( kbAltA ));
  1425.      prints the single letter A.  Procedure Getaltcode maps characters back to
  1426.      Alt-Ch combinations.
  1427.  
  1428.  
  1429. GetAltCode function
  1430. ------------------------------------------------------------
  1431. Declaration: 
  1432.      function GetAltCode( Ch: Char): Word;
  1433.  
  1434. Unit: Drivers
  1435.  
  1436. Purpose:
  1437.      Maps a single character 'A' to 'Z' to the Keycode equivalent value for
  1438.      pressing Alt-Ch.  For example,
  1439.               GetAltCode ('A')
  1440.      returns $1E00, which is the value of kbalta.  Getaltcode is the inverse
  1441.      function to Getaltchar.
  1442.  
  1443.  
  1444. GetBufMem procedure
  1445. ------------------------------------------------------------ 
  1446. Declaration:  
  1447.      procedure GetBufMem( var P : Pointer;  Size : Word );
  1448.  
  1449. Unit: Memory
  1450.  
  1451. Purpose:
  1452.      Used to allocate a cache buffer where the cache buffer is a heap
  1453.      allocation that may be moved or disposed of at any time by the memory
  1454.      manager.  As a result, the pointer variable passed to Getbufmem may be
  1455.      changed by the memory manager at any time during program execution to
  1456.      point to a different memory area, or even be reset to NIL.
  1457.              Turbo Vision uses cache buffers to speed up output the screen
  1458.      (also see TView's Options field and the ofxxxx constants) by having views
  1459.      store their display image in memory so that, if possible, the screen can
  1460.      be updated quickly merely by copying the memory image back to the screen
  1461.      (this is faster than regenerating the text and other data in the Draw
  1462.      method).  However, when Turbo Vision begins to run low on memory, it
  1463.      starts throwing away the cache buffers, as needed until enough memory is
  1464.      freed up.
  1465.              In addition to Turbo Vision's use of cache buffers, your
  1466.      application can use cache buffers for storage that can be deleted by the
  1467.      memory manager in case memory is running low. An example use might be to
  1468.      cache the disk directory read into the TVSHELL8 sample program of Chapter
  1469.      12 in the Borland Pascal Developer's Guide.  If for some reason Turbo
  1470.      Vision or some other part of the program requests memory and there is not
  1471.      enough free memory in the heap, then the memory manager will dispose of
  1472.      one or more cache buffers, and set the corresponding pointer to NIL. Since
  1473.      the TVSHELL program can always recreate the directory structure by reading
  1474.      the disk directory again, its okay to reallocate this memory to some other
  1475.      function.  Cache buffers are useful for speeding up access to items that
  1476.      can always be recreated.
  1477.      See:  Freebufmem.
  1478.  
  1479.  
  1480. GetKeyEvent procedure
  1481. ------------------------------------------------------------
  1482. Declaration:  
  1483.      procedure GetKeyEvent(var Event: TEvent);
  1484.  
  1485. Unit:  Drivers
  1486.  
  1487. Purpose:
  1488.      Uses the BIOS function INT 16H, Function 01H "Read Keyboard Status" to
  1489.      determine if a key has been pressed on the keyboard.  If so, Event.What is
  1490.      set to evkeydown and Event.Keycode is set to the scan code of the key.  If
  1491.      no keys have been pressed, Event.What is set to evnothing.  This is an
  1492.      internal procedure called by TProgram.Getevent.
  1493.      See: evxxxx constants, also DOS Programmer's Reference, 2nd Edition, Que
  1494.      Books, page 496,
  1495.  
  1496.  
  1497. GetMouseEvent procedure
  1498. ------------------------------------------------------------
  1499. Declaration:  
  1500.      procedure GetMouseEvent(var Event: TEvent);
  1501.  
  1502. Unit:  Drivers
  1503.  
  1504. Purpose:
  1505.      Similar to Getkeyevent, but for mouse events.  This internal procedure
  1506.      checks Turbo Vision's internal mouse event queue, and if a mouse event has
  1507.      occurred, sets Event.What to the appropriate evmousexxxx constant;
  1508.      Event.Buttons to mbleftbutton or mbrightbutton; Event.Double to True or
  1509.      False; and Event.Where to the mouse position in TApplication coordinates. 
  1510.      If no mouse events have occurred, Event.What is set to evnothing.
  1511.  
  1512.  
  1513. gfxxxx constants
  1514. ------------------------------------------------------------
  1515. GrowMode Field constants
  1516.  
  1517. Unit:  Views
  1518.  
  1519. Purpose:
  1520.      The gfxxxx constants set the TView.Growmode field, which controls how a
  1521. view grows in relation to the view that own's it.
  1522.  
  1523. Constant       Value    Usage
  1524.  
  1525. gfgrowlox      $01     The left side of the view will stay a 
  1526.                        constant distance from it's owner's  left
  1527.                        side.
  1528. gfgrowloy      $02     The top of the view will stay a constant
  1529.                        distance from it's owner's  top.
  1530. gfgrowhix      $04     The right side of the view will stay a
  1531.                        constant distance from it's owner's right
  1532.                        side.
  1533. gfgrowhiy      $08     The bottom of the view will stay a
  1534.                        constant distance from it's owner's  
  1535.                        bottom side.
  1536. gfgrowrel      $10     The view will maintain its size relative
  1537.                        to the owner.  This flag  should only be
  1538.                        used on TWindow derived objects and is
  1539.                        intended for  keeping  windows adjusted
  1540.                        relative to their owner when switching
  1541.                        between 25  line mode and 43/50 line
  1542.                        screen  modes. 
  1543. gfgrowall      $0F     The view should maintain the same size and
  1544.                        move with respect to the  lower right
  1545.                        corner of the owner.
  1546.  
  1547.  
  1548.  
  1549. hcXXXX constants
  1550. ------------------------------------------------------------
  1551. Help Context constants
  1552.  
  1553. Unit:  Views
  1554.  
  1555. Purpose:
  1556.      The hcxxxx constants are used in conjunction with on-line help. Values 0
  1557. through 999 are reserved by Turbo Vision, but user written applications may use
  1558. any value in the range 1,000 to 65,535.
  1559.  
  1560. Constant       Value    Usage
  1561. hcnocontext     0      No help context specified.
  1562. hcdragging      1      The object is being dragged.
  1563.  
  1564. See:  See "Adding On-line Help to Turbo Vision Programs" in Chapter 13, "More
  1565. Turbo Vision Features" in the Borland Pascal Developer's Guide.
  1566.  
  1567.  
  1568. HideMouse procedure
  1569. ------------------------------------------------------------
  1570. Declaration:  
  1571.      procedure HideMouse;
  1572.  
  1573. Unit:  Drivers
  1574.  
  1575. Purpose:
  1576.      This procedure is used to hide the mouse, making it invisible on the
  1577.      screen.  Each time Hidemouse is called, it increments an internal "hide"
  1578.      counter.  Showmouse decrements the internal counter and when the counter
  1579.      returns to zero, the mouse cursor will reappear.  Therefore, you can nest
  1580.      calls to Hidemouse and Showmouse but there must always be the same number
  1581.      of each.
  1582.  
  1583.  
  1584. HiResScreen variable
  1585. ------------------------------------------------------------
  1586. Declaration:  
  1587.      HiResScreen : Boolean;
  1588.  
  1589. Unit:  Drivers
  1590.  
  1591. Purpose:
  1592.      Returns True if the screen supports 43 or 40 line modes, False if these
  1593.      modes are not supported.  This routine should only be called after
  1594.      Initvideo is called via TApplication.Init.    
  1595.